/**
 * 
 */
package org.arpit.masteringextjs.domain;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

import org.arpit.masteringextjs.enums.Rating;
import org.arpit.masteringextjs.jsonserializer.LanguageToIdSerializer;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;

/**
 * @author arpit
 * 
 */
@Entity
public class Film extends BaseEntity {

	@Override
	@JsonProperty("film_id")
	public Long getId() {
		return super.getId();
	}
	
	private String title;
	
	@Lob
	private String description;
	
	@JsonProperty("release_year")
	private int releaseYear;
	
	@ManyToOne
	private Language language;
	
	@ManyToOne
	private Language orignalLanguage;
	
	@JsonProperty("rental_duration")
	private int rentalDuration;
	
	@JsonProperty("rental_rate")
	private float rentalRate;
	
	private int length;
	
	@JsonProperty("replacement_cost")
	private float replacementCost;
	
	private Rating rating;
	
	@JsonProperty("special_features")
	private String specialFeatures;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getReleaseYear() {
		return releaseYear;
	}

	public void setReleaseYear(int releaseYear) {
		this.releaseYear = releaseYear;
	}

	@JsonProperty("language_id")
	@JsonSerialize(using = LanguageToIdSerializer.class, as = Language.class)
	public Language getLanguage() {
		return language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@JsonProperty("original_language_id")
	@JsonSerialize(using = LanguageToIdSerializer.class, as = Language.class)
	public Language getOrignalLanguage() {
		return orignalLanguage;
	}

	public void setOrignalLanguage(Language orignalLanguage) {
		this.orignalLanguage = orignalLanguage;
	}

	public int getRentalDuration() {
		return rentalDuration;
	}

	public void setRentalDuration(int rentalDuration) {
		this.rentalDuration = rentalDuration;
	}

	public float getRentalRate() {
		return rentalRate;
	}

	public void setRentalRate(float rentalRate) {
		this.rentalRate = rentalRate;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public float getReplacementCost() {
		return replacementCost;
	}

	public void setReplacementCost(float replacementCost) {
		this.replacementCost = replacementCost;
	}

	public Rating getRating() {
		return rating;
	}

	public void setRating(Rating rating) {
		this.rating = rating;
	}

	public String getSpecialFeatures() {
		return specialFeatures;
	}

	public void setSpecialFeatures(String specialFeatures) {
		this.specialFeatures = specialFeatures;
	}
}
